package com.wn.icloud.plugin.generator;

import com.google.common.collect.Lists;
import org.apache.commons.lang3.RegExUtils;

import java.io.File;
import java.util.List;
import java.util.regex.Matcher;

/**
 * @author kyy
 * @date 2019/04/13
 */
public class BaseCodeGenerator {

    protected String mavenModuleName;
    protected String basePackage;
    protected String moduleName;

    protected String basePackagePath;
    protected String modulePath;

    private boolean overwrite = false;

    private List<String> noOverWriteDomain = Lists.newArrayList();

    public BaseCodeGenerator(String mavenModuleName, String basePackage, String moduleName) {
        this.mavenModuleName = mavenModuleName;
        this.basePackage = basePackage;
        this.moduleName = moduleName;

        this.basePackagePath = RegExUtils.replaceAll(basePackage, "\\.", Matcher.quoteReplacement(File.separator));
        this.modulePath = RegExUtils.replaceAll(moduleName, "\\.", Matcher.quoteReplacement(File.separator));
    }

    public boolean isOverwrite() {
        return overwrite;
    }

    public void setOverwrite(boolean overwrite) {
        this.overwrite = overwrite;
    }

    public List<String> getNoOverWriteDomain() {
        return noOverWriteDomain;
    }

    public void setNoOverWriteDomain(List<String> noOverWriteDomain) {
        this.noOverWriteDomain = noOverWriteDomain;
    }
}
